package l.com.tableview;

import android.view.View;

import java.util.Stack;

public class Recycler {
    public Stack<View>[] views;

    public Recycler(int typeCount) {
        views = new Stack[typeCount];
        for (int i = 0; i < typeCount; i++) {
          views[i] = new Stack<>();
        }
    }


    public void addRecycledView(int type, View view) {
        views[type].push(view);

    }

    public View getRecycledView(int type) {

        try {
            return views[type].pop();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }


}
